corrected supply func