Adjusted spacing and added additional check (line 12)