made the init script more flexible