left and right logic