Added logic to Putting-it-all-together