fixing some blocks and formatting