rewrote layout algorithim to give random combinations