* revised layout algorithm