experimenting with layout algorithm