Implemented the 6 first basic phases.

Maybe tests should be implemented.