moved ascii posting logic to a function