continued modifying algorithms to do arithmetic in place; they now compile