Added functions rot_vec and bb_map.