added upgraded solution