bug fix closes #11, also happens to improve perf for #8 a bit, weirdly