First working version

Reworked BoL script.