added an alternative solution