scaffold files and fix bugs