copied bits from old cs100