added support for multiple balls