fix another bug, now need to clean up comparison function