added project 5. continued prog 6 read val function