Headaches and Insomnia

I'm 5w3d and the past week and a half or so, the headaches have been just awful and I can't sleep for anything. I cut the caffeine in effort to make falling asleep easier, but the withdrawal (I think) of caffeine is maintaining persistent headaches. I feel like I can't win either way! What to do??? I'm exhausted!!!