Changed 'continue' to 'loop' and if conditionals