added replaced funtionality