nit:
use True or False instead of 0/1