Performance Changes

A function to close connection has been added to compensate for the
program not being multi-threaded.