Cleaned up the scripts quite a bit