Stable version. Fixed some buges. Cleaning code.