fix arrays and update to work with bluetack (hopefully)