fixed a weird topleft move bug and wrote unit test for that case