removed recursive code