Added OS detection, auto looping