Added some comments
Added comments for function documentation, started threads.
Finished commenting and coding parta, should work correctly