code moved to run method