added code for mlclass-ex2