smarter code for letterboxes