Commented and changed some names to better reflect class usage in design patterns.