Adding math functionality and better geometry