fixed compile errors and return types