fixed issues pointed out by slayer95

should have fixed the indentation and edited the  immunity check