prepare from the given data