Updated to version 8 code from JSBin