refactored code and took out unnecessary elseif code