work on branch simulation logic