made it into a C solution