code cleanup
better algorithm
problems with coordinates between models and view (?)