put everything into 'if' statement