output from c not right