eddy's code for study