Added divisions, bug fixes