Implemented mouse logic. More work needed on it.