added function for filter for given interval + minor changes