some codes in learning