Second solution for #1