I should probably restructure this function ti work with Point instances