Changed so that the instance class can be changed by user