added filter as an input in two functions, fixed small bug with xym/mat file copy