almost ready, some bugs to fix