Working on Python data structures