Written for an interview code test