Added code for the replacement form