added left, right and mid functions