fixed pinning layout algorithm