cleaned up code. added comments. optimised buddy_alloc.