Subdirected code
Merge pull request #2 from iHiD/rearrange_code

Restructured the code