Added option to only keep certain scanranges