Support to receive dict as input

I've added some lines to receive a dict also as input.