tested on dev-c++;