removed unused functions

removed unused functions, translated some vars and functions.