Changed logic solution to .net 4.5