nit: instead of entries[0], you can do entries.first, which is a little bit more semantic