Added code to return and removed echo from functions.