Knowledge is power. When you understand more about sleep mechanics, you will be able to make smarter decisions. The most important thing about sleep mechanics is that we sleep in cycles of around 90 110 minutes each. A good time to wake up is at the end of each cycle. So try to adjust your alarm to turn on a the end of a sleeping cycle. For example, to wake up at 400 am, you have to sleep at 1000 pm to have 4 cycles of sleep approximately. Or try setting your alarm an hour and a half before you have to get up, then resetting it to the proper time when it goes off. You should wake up more alert, since you have finished a complete sleep cycle.