rewrite with cpp and vectors
Rewrote with cpp and vectors, now works fine
Merge branch 'master' of github.com:tehnhk/myshit