rebase + bugs fixed