fixed up example and some js