Change changing of directories

Remove cd from functions
Change directory once in the beginning