Checked for bugs and fixed the few I found
Merge pull request #55 from elenasharma/check_for_bugs

Checked for bugs and fixed the few I found