run though main code