init code for study