Added more helper functions to MPM kernel file.