Updated algorithms to find moves