getting rid of bad code