Cleaned up function parameters
Adding missing const in prototypes