code now compiles, barebones, needs to be tested on device, also needs resets etc