Cleaned the code. Used Regex in manipulation of string.s