fixed layout algorithm