formatting and text to index