Oh I see. Yeah, that's what's making it stretch like that. The plant isn't getting enough light, so it's assigning more of its energy towards growing taller in order to get closer to the light source. You want that energy to be used on more foliage so they grow short and bushy. If they grow tall and lanky, the stalk isn't going to be thick/strong enough to support the weight of buds later on in flowering.
If you want to use the sun as a light source, you need to have your plant outside under direct sun. They're not going to get enough light just sitting in the window. Hope this helps. Good luck and happy growing!