Made the code that switches screens more efficient.