Updated lots, reorganized code