Added stage2 and strlen function