all functions are working now