fixed bug with key and added textwrap