completed most logic changes