Fixed up header file

Fixed up the header file so that it follows a more logical approach.
Also small fixes