Fixed filter bug
tidied up