working implementation of morse decoding