almost all functions partly working