this is the correct working script for programming assignment 3