Cleaned up a bit, and added copyright notice