reformating and cleanup thx to http://astyle.sourceforge.net