inspiration: thekarangoel/projects, but in c