more or less finished 2. assuming the problem definition is incorrect.
corrected bug (misunderstanding)
finished problem 3. woohoo.
Merge branch 'master' of https://github.com/nyucusp/gx5002-fall2013