use 1/0 instead of true/false, change comments to be compatible with cc compiler