cleaned up socket connection code. added incrase and decrease methods