adding serialization to CaustkMachine framework