IMPROVE: split Lib Tom Maths into separate functions