code opt for ass3