upadted code: our plan didn't work