added comments
better looking code
check threads
original project once again