fixed many things related to the talk we had with aslak today.
may be extremely buggy, since i don't have time to test
nearly didn't have time to finish writing the code D: