implementing relative positioning while resizing