Logic for bounce direction improved, no more rand().