Fixed many bugs, but still a lot open.