Implements conditional move