finish train problem with Struct and hashes