made ansi-c compiliant