Added more functions

nested loop and returning numbers