Cleaned up code and updated copyright goodness.