updated code for testing with brown corpus