removal of insane code with sane code