added Bar class (including draw function and move function) and modified initialization of context when onload function called