Added a proper header and fixed outstanding errors