code to do mass range intersection