driver code for ex. 1