1-4 complete with specs and jsfiddles