Added some of Mak's source code from class