Flat detection implemented and working on PC. To test on an Androiid machine