some modificiations made