finished client script and slightly improved controller script