How do I calculate end of year inventory? Beginning of Year+Purchases-Sales calculates like I don't have any inventory left; which I do.

I started an online store in 2016, ending inventory $4339, purchased $12,170 "wholesale" in new inventory, total 2017 "retail" sales of $16,033. If I use the formula of Beginning of Year + Purchases - sales then the calculation shows I have no inventory which I do. I'm so confused.