added all of example functionality