add flags to the spectun.prepare function