Modified to work both on PC and Android.