figuring out syntax error also why calculations did not come out correct