Converted Caulis shuffle function to coffeescript