added bit array and card routines