code updated more readable