Main function complete, debugging