Write it out then, quickly, before you stop. On paper, that is, with a pen/pencil. Write in pseudo-code if it helps get it on paper faster. Stick that to your monitor or under your keyboard, it'll be there the next morning. If you got it right, typing it in will be easy. If, the next day, you see things differently, you will be past the first draft.