easier problem for profile
optimize a bit
optimize a bit