changed some $var and output statements
working thru example #1