added code and tic figure