- fixed bugs and seems to work on most cases now