changed to elseif as requested

Would prefer a switch/case structure myself!