Fixed bugs, need more fixing