created algorithm base