Starting p4, not sure if it works, need to fix the write out to file portion.