Added some code to the PM module