Issue 790: initial commit

Created codes() method. Please review it.