adding more elegant solution