Cleaned up version. Layout and zooming still to come