cleaned up example code