moved main.js into lib as well