* Migrate some utils to TS * Add argument type * Fix logic * Refactor math functions * Rename function