Added rest of code.

Signed-off-by: Olivier Laforest <olivier.laforest@mail.mcgill.ca>