fixed errors by inserting _> operators in the end function