updated parse algorithm with string slicing