I am sorry that the source is so messy. I have not yet gotten around to figureing out how to work with .h files so I apologize for the huge one file.