Added #ifdef statements to conditionally include debug-related serial print statements