Updated with test code