changed things so that it accounts for return statements