code for test and study