Added isLeft function