use stdbool.h, moved constants and vars into header