add another idea to speed-up code