Major Update

Fixed about 300 bugs and made source code more portable.

I wrote this code for my school when i was in school so this code is not
very beautifully written but it does its job. if you find any other bug
then please let me know.