matrix elements calculation added