Cleaned functions section
Fixed incorrect binary shift value and data types
Major fixes, alot of debugging to do