Detects right margin