moved a method from Problem027
standardized output and comments
standardized output and comments