converted to pythonic style
simplified and refactored code a bit
changed data types and spacing
Merge pull request #1 from goldsmith/master

Cleaned up code