Reformatting code and fixing loser ID bug