fixed some errors and more refactoring
fixed gerald's pedantic comments
Merge pull request #8 from sharadmv/abstraction

fixed some errors and more refactoring
yayz