restructured conditionals; added between if statement