Fixing removeArtefact function