Lost our baby boy today

Karen
17weeks 6 days ..I know I felt the baby moving at 15 weeks ..for the last week I felt like something was wrong. 
Yesterday we went in for an ultrasound and should've found out the sex instead we found out our son had died . He was measuring a little over 14 weeks but doctor said he could've shrunk if he died between 15-17 weeks ...I chose to have him myself and stayed at a hotel next door to my hospital so I could take the baby and placenta to them for tissue samples. My doctor is awesome she let me have the baby MY way and gave him back to me so we could have him cremated. Very confused and obviously upset but waiting patiently for answers at this point as to why this may have happened ..a late missed miscarrage at 17 weeks..