script is fully funtional