Added the smart layout's function(need to fix)