Use spaces instead of tabs, make executable
Add main(), slight refactorization