created prepare() method