split clusters filtering into function
split clusters filtering into function
minor changes
minor changes