Added serialize and parse methods