Nested Ifs and sub-Routines