Iron out bugs and formatting