added more tests
cleaned up some code based on go vet