Cleaned up the code and added some info printf()'s