finally working parsing