worked on functions