updated for new project structure, fixed bugs, added doc