I am not all that familiar with Proton? So you may have better luck here
http://www.protonbasic.co.uk/

But one thing I did see that might be the problem is the includes are at the end of the code...