Nearly finished main scripts.