finished scripts ; should be fully refactored