Keawe is horrified, but uses the money to build his house, before selling the bottle to a friend.
Keawe is horrified. This is before selling the bottle to a friend. Keawe uses the money to build his house. This is before. Keawe is selling the bottle to a friend.