unixified port by ccr <3