Some code refactoring and fixed the bug in collision detection (in y direction) Collision in x direction not implemented yet