now throws indexed positions into database