Semi-rewrite. Now uses lang.js