Fix the logic for the back button so that it evaluates the OS properly with a single if statement and one or.
Cleaned the code.