Incorporated serial console and made it work, added some debugging messages