edited for compatiblity to Windows with MinGW