Updated script handling optional features