Made score based on pipe pos. Ahmed's code still there, just in comments among other things.