Codes from algebraic number fields