fixed the problem with my layout algorithm. FINALLY.