refactored chartotest > c to meet exercise requirements