bloody inefficient layout generation but renders nice things