New design partly implemented

New design partly implemented, bugs repaired.