Fixed more bugs, test is kinda working.