Removed dead code and fixed move calculation