implemented command arguments
Updated onconnect
Some unit tests