Initial Commit

Refactored, commented. Initial commit.

version 1.0.1