works. still need stepwise expansion