added tests, correct divison and changed formual handling