add function right and left