Rewrited billard as object oriented program