fixed build issues, changed profiling functions