add new functions for value replacement