adding a replace function (#11)