Added another implemention with additional commenting