refactored and added FormatMessage function
small syntax error fixes
small syntax error fixes no. 2
small bugfix in function GetFormattedTime. Works