added more time and space measurement