Structure the code in functions, Y errors.