Updated with testing function