Fixed FACING_LEFT/RIGHT and cleaned up code