created a seperate divide function properly