new try at pids using different way of syncing variables