Faster implementation

Run 'go test -bench .'