added marker detection (not perfect)