fixed bug in function and changed how it works a bit; changes reflected in usage of function. Ugh.