Implemented code to end after 30 second runtime.