Fixed bugs, added new output