implement main client side logic