added code for creating instances