added function for df conversion