Adapted feature popup code to Jay's approach.