Few bugs with outputting the data