test was helpful but code itself seems iffy