handle multiple directions (top, left, bottom, right)