added prepare() method