Changed move logic
Added tests