fixing a bug, also adding tests which helped find the bug! wooo! (#24)