rearranged some function, started working on a dictionary