adding prepare() method