still some minor calculation problems