removed unused regex
minor changes plus comments