added flag + a few new functions