added enumeration code and example 2 code