Closes #23. Fixed indentation, reduced complexity, and added missing tes...

...t case