Fixed class declaration and added bar function