Source: http://www.cs.cuhk.hk/~lyu/student/fyp06/LYU0604/Report_Sem1.pdf