improved BSLW script with the final requirements