updated version better parsing