new membership function, tweaks to other functions