Updated with new function