work in progress in pat parsing