added solution to the filter problem