fixed vars in the class and added some functionallity