working on replacement code