prob12: tried improving performance, but ended up worse :(