Added new prepare function.