Added left/right setting. Cleaned up some unused code.