Dont know if this will work but it may be worth a shot. Go through though array and look for junctions, decide randomly whether this junction is going to become a room or just remain a junction. Once thats done for all junctions use the length of the passage that the junctions lie apon half the length minus a random number this gives you a length in one dimension, the rooms wont overlap for the most part, they will be like an overlay on top of the passages. if rooms do overlap they will combine to form non rectangular rooms