Almost done.
Bug tested in Chrome/Firefox