Moving algo to blink-style js