add messy code from class