how about we totally write this in javascript?