fixed minor bugs regarding output