removes extraneous  code