Added logic to work out how box is launched when mouse released