resolves #4 with help from @bradleydeutsch