Rewrote Morse to use functions