added prepare() function. removed 'cp'. style fix.