Gdp 827

Formatted entire function, so my apologies for not being able to see the diff on that :/

Changes happen on 1250 - 1272