Adjusted the precedence() function. Cleaned up code