First real commit. Also a bit of refactor and added some comments.