fixed filter implementation (now callback), added sort method