edited balltable
fixed some bugs
ok
refactoring