rewritting to a compiling single file library