move genInvMatrix to main file