add cs193 assign 1; and copy the code from book