functions working now