Fixed indentation and added if and else snippets