changes for new flexible frame-based layout - not yet complete