Added MIT License and links

Added MIT license, added links to the sources used and functions copied verbatim