this seems to be working for most cases...
adjusted some comments. still works. i think
working fine but not interactive.