cleaned up example and added docs