add Ruby character counting and update JS