bucket function works now