fixes
latest changes
more complete version
fix compile errors
not working on cygwin
heres code
initial commit