started work on rewriting enhance.js