example core removed. Comments added, main updated