need to test and fix integer calc