Main idea implementation