added phase 1, 2, 3 to output for log file
fixed bug in aligned delimiters and closing braces (bug #13)