work on the replacement code