use switch
use go's syntax
Merge pull request #61 from Mistobaan/master

some go cleanups