modified division and fixes