adding better parsing
bug fixes