Code modified to be compiled with newer versions of g++ (4.8.1)
Code stylized