Added pseuodocode adnd defined a method