Revert "Revert "updated functions""

This reverts commit 1ccb730dacce38d9fbdad5d60d0bc7b9ebd83edc.