first attempt at detecting branch