removing debugging output and adding msg encryption