Use boolean instead of integers. Fix comments