Wrappng class and added run() function
Fixed IndexError
Fixed variable name