removed recusion