updated to_ascii implementation; added tests