Fixed code and set correct integer output format