fixes #145 a couple of tweaks to make it legit