fixes bug, and formatting some values