Grab interview question

Fix a bug in a function