removing reliance on hard coded path of flash file, and reformatting some code.
Merge remote-tracking branch 'origin/master'