implements simple loam claculator using JS