Adding new code from slides