adding console functionality & some fixes & comments