Replaced test function with one that works