work for multiple measures
generalizing to different measures