added method moveLogic