working version with precedence and everything else hooray