Updated to handle subjets properly