added classes and functions