all in coffeescript + the total function is working!