setting up direction bits