Forked code to allow for preview