Changed solution to 2012 version.