both those ends should be indented as they close the inner if conditions