renaming variable, fixing small bugs