Added if statements and changed viewport