The Program is optimized and takes input from the user.