first implementation of concurrent scripts (unpolished)