optimizations
most of features implemented
fixes