added run-time analysis