rename most variables and delete things not used