origional source code from professor