new scripts and multiple bug fixes