fixes #152

@weierophinney  Please see my changes to solve this issue. 

If I need to change any of the code please let me know.