Code clean-up. Implemented client-main.