Fixed const stuff, removed unused functions, fixed getIndexAtPoint. Still broken