Changed name of function to dfsPrint and moved stack push statement