testing reccurence vs stack