rename some functions, add comments, some graphical improvments