Started solving in perl