finished: 'prepare' function