updated to retleths latest whit exception of some movements of functions