fixed typos, modularized methods, extended docs/todo