looped based on legth in case ans less than 5