implemented method for creating new instance, but runs badly