added serialize to & from input stream
added serialize to & from input stream