first implementation of standalone version