Change ball's direction

A small change and delete some useless function