Move to better layout calculation

Fixes #17