Removed debug stuff and some resorting and more..