fixed silly pointer error and cleaned up funciton types