Now tracks memory useage
connect function is now an IFI
Now tracks memory useage