added algo. outline for join_bits function