fixed line wrapping errors
added debugging code