added more performant solution