Cleaned up code, edited the README for documentation.