Updated the code to deal with two dimensional points