Added inward and outward codes