Now it's possible to retrieve data once connected, though code is still messy and unoptimized.