adds code for mouse handling and key
more changes to index