check in ray's modified preview code