start removing math.abs
remove unnecessary bits, formatting and tidying