Added comments and MIT licensing to all the code