added alternate solution