re-writed code, added final API, create place for other features!