let working. still need to check variable scoping.