added trainmat