Many changes, thanks to thezoggy.