refactored into modules, added private method, and added first documenta...

...tion