Pdf generation added though not fully working yet