Re-structured Code

Along with re-structuring the code I resolved #52 and #39.