having problems with the math...output always wrong working on debugging