I was on Instagram, making a comment on a friends photo when randomly my phone froze (on Android N preview which I've been running for months now) and i couldn't press the home or recents button, everything was completely frozen for about 5 seconds. Then the screen went black and it was off. I tried to turn it back on but got no response. In about 20 minutes, after pressing/holding the power and volume buttons in random combinations for random amounts of time, it finally gave me the unlocked bootloader screen, then went to the Google splash screen, then black. It does this every time that I manage to get it to boot (which isn't often). I managed to get it to the bootloader, but recovery does the exact same thing except for no reason one time it booted fully into twrp where I flashed the stock Marshmallow rom and all. I tried to reboot and it told me I had no OS installed. So i rebooted anyway, since that made no sense, and still, black screen. I have no idea what's going on but it's very strange and I need my phone for tomorrow. This is driving me crazy