adapted to points object ( need to fix this )