added error check and pulbic static codes for word retriaval methods