Adding logic to pick data from file