Fixed bug and formatting