migrate more from jsfiddle