Code clean up getting ready to do output
Added output writer.
Output for single record now works...
Added things..
Code clean up