Added stand-alone code