Made big changes to PKM Writer