Added __name__ block, added extract listings function