advance function works now