fixed some bugs and added integration of ball colours