fix code to conform with ansi standard