mid term solution to pattern classfication