cleaned up code and fixed issues with arrows