Simplified logic my moving all into the render() methond.