modified by Anand; Add the semi-supervised method