Implementation of Main Client