Repaired static function for retrieving last instance, wrote function that deletes most recent instance.