Added class structure
Class structure plus boolean handling