added code for mean shifting, haven't tested or debugged yet