Added more function definitions, started implementing message format
checking.