further fixes to learning code.