Finished code from presentation