Is it okay?

Is it Normal if my blood turns brown closer to the end of my period, and why?