Added a little cacheing. Also doesn't render unless there are changes.