Almost finished with second script implementation. Just need to test it several times