Fixed bugs
Replaced tabs with 4-spaces, added import statements
Fixed bugs, added lots of comments to top