coded edit function for chances, small other additions