changed internal logic