Improved WrapPanel. Thanks @davesmits