Cleaned up mission code