Someone please explain

Meghan
How long before your period does ovulation occur and can it sometimes cause spotting and cramps ?