got the last two functions to finally work.