Added comments
Added comments
Moved reading keys from thread to server.