Forward declarations added and formatting