reworked to whole thing...got rid of helper function