creating function to parse bit data and return string of command