impl: change points to number field + fixed some jslint errors