Using function,delete other code