Cleaned Methods

Made output a separate method.