added quality of life features to C version, cleaned up formating there as well