stubbed within function
first pass at within function (not working yet)