almost there, need to fix problem with duplicate coordinates