Selflearning cods