renamed file and put code in class