Working fine now, just need to work on the output