Correcting originial code