Updated to match homeshick's new operation, only commented out old version for the moment