changed all printf to sprintf as something not liking it