keep (something) straight (in one's mind/head)
To be able to understand something clearly and comprehensively; to keep the details of something clear in one's mind. This project is getting so out of control. I can barely keep it straight in my mind anymore! I'm no good at lying because I can never keep my story straight!