Added a class to handle direction.
Updated init and loop.