a saner layout with a few fixes, but still not complete