fixed a chunk of errors, expanded function signatures to match h file