Adding some troubleshooting output. Should be made into a function later.