function replacement seems to work