editted ending, picked up bugs