Actually, you are very right. The TORAH was in the beginning. The Almighty
aish.com/spirituality/philosophy/Maimonides_Eighth_Principle_The_Divinity_of_the_Torah.asp
aish.com/literacy/concepts/Writing_the_Torah.asp
“Moses wrote all of God’s words” (Exodus 24:4). Before completing the covenant, he read this part of the Torah. It is written, “[Moses] took the Book of the covenant, and read it so that the people would hear. They said, ‘All that God has spoken, we will do and we will listen’” (Exodus 24:7).
After this, God would call Moses to the Tent of Meeting (Ohel Moed) to dictate the Torah to him. God would call Moses, and Moses would acknowledge that he was ready.
God would dictate each passage, and Moses would repeat it aloud.
God would dictate each passage of the Torah to Moses, and Moses would repeat it aloud. He would then write it down.
God would dictate a paragraph to Moses, and then give him a break in order to consider it. These breaks are preserved in the Torah in the form of spacings, dividing the text into paragraphs (parshiot).
So, yes indeed - it was in the beginning.