Added deserialization, made some modifications