Added first() method to replace filter(...)[0] to allow compatibility with Python 3