adding new routines, shake function, and fixing bugs with divided functions