Kutzki is definately right. However, your writing style is the same as mine. I am finding that by altering the end of a part, and the begainning of the next part can tie the two together sometimes. Sometimes I have to transpose parts (to the same key). Other times I have to alter many notes (harmony or melody or both.) Sometimes it works, and sometimes it doesn't. There was one really long meldoy that I wrote. I wanted to use it in a different song then the one it was in. After I made all the alterations to it to fit the song it sounded completely different, and much cooler then the original idea. I've had to simplify alot of ideas to make them work in harmony with other ideas. Also have you tried writing the lead pattern first, and then tighting the rhythm to the lead?
Bass guitar is the answer to everything