fixed class and methods, added some function