added collectGarbage function
added docs