Added new output code. Closes #3