refactored points to be a bit more functional