implemented left/right resize behavior