using dictionaries

using a dictionary for handling tasks selection rather than arrays.