added <sys/resource.h> + other hacks