Issue: #190.
cleaned up code to follow same style as before