new functions (rip) and some changes