Fixed indentation and added missing end statement