First functional version. The manual interaction not fixed yet.