added tets cases and cleaned up