added handling for quote marks
lots of cleanup