Added code blocks and if statement.