change of plann built a class for database