add run method and tests