rewrote in JS, finished off, implemented countdown etc.