This is code for an interview question