First swing at client-side code