buildProfileMat method added