Removed printf and fixed poorly formatted code