Working version. Switching to broadcast receivers