Tidying up - refactor math code into its own folder