updated for new function