Finalization

Finalized class and corrected logical errors