Added init function and comm parsing function