Shit code ahead.