changed to all one type of linq
refactored the Run function