Fixed a few errors. Need to think more about scope to keep modularity