More changes. Fleshed out some functions.